package com.example.crondemo.controller;

import com.example.crondemo.result.CommonResponse;
import org.springframework.web.bind.annotation.*;

/**
 * @author yanbl
 * @version V1.8
 * @Description: 登录接口
 * @Date 2021/7/1 10:31
 */
@RestController
@RequestMapping("/user")
@CrossOrigin
public class LoginController {

    @PostMapping("/login")
    public CommonResponse login() {
        return CommonResponse.ok().data("token","admin");
    }

    @GetMapping("/info")
    public CommonResponse info() {
        return CommonResponse.ok()
                .data("roles","[admin]")
                .data("name","admin")
                .data("avatar","https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif");
    }
}
